package za.ac.wits.elen7045.scraper.providers.payfine;

import za.ac.wits.elen7045.integrity.checker.interfaces.IntegrityCheckingInterface;
import za.ac.wits.elen7045.persistence.model.ServiceProvider;
import za.ac.wits.elen7045.scraper.interfaces.BaseScraper;
import za.ac.wits.elen7045.scraper.interfaces.BaseScraperMappingEntities;
import za.ac.wits.elen7045.scraper.providers.testing.MappedEntities;

public class ScraperService extends BaseScraper {

	public ScraperService(ServiceProvider serviceProvider)
	{
		super(new MappedEntities(), null, serviceProvider);
	}
	
	public ScraperService(BaseScraperMappingEntities scraperMappingEntities, IntegrityCheckingInterface integrityChecking, ServiceProvider serviceProvider) 
	{
		super(scraperMappingEntities, integrityChecking, serviceProvider);
	}
	
	@Override
	public void scrapeSite() {
		// CALL 3RD PARTY
		String xml = "<scrape-session>" +
						"<base-url>www.payfine.co.za</base-url>" +
						"<date>10/01/2008</date>" +
						"<time>13:50:00</time>" +
						"<datapair id=\"001\">" +
						"<text>Account no</text>" +
						"<value>53844946068883</value>" +
						"</datapair>" +
						"<datapair id=\"002\">" +
						"<text>Service ref</text>" +
						"<value>0117838898</value>" +
						"</datapair>" +
						"<datapair id=\"003\">" +
						"<text>Previous Invoice</text>" +
						"<value>R512.22</value>" +
						"</datapair>" +
						"<datapair id=\"004\">" +
						"<text>Payment</text>" +
						"<value>R513.00</value>" +
						"</datapair>" +
						"<datapair id=\"005\">" +
						"<text>Opening Balance</text>" +
						"<value>R0.78</value>" +
						"</datapair>" +
						"</scrape-session>";
		super.mapXmlToScraperSession(xml);
	}

}
